cmake_minimum_required(VERSION 3.5.0)
project(Corynet LANGUAGES C CXX)

if(NOT CMAKE_BUILD_TYPE)
  set(CMAKE_BUILD_TYPE "Release")
endif()

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CXX_FLAGS
 -g
 # -DVALGRIND
 -Wall
 # -MMD
 -rdynamic
 )
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
  list(REMOVE_ITEM CXX_FLAGS "-rdynamic")

set(PROJECT_BINARY_DIR build)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)

message(STATUS "CXX_FLAGS = " ${CMAKE_CXX_FLAGS} " " ${CMAKE_CXX_FLAGS_${BUILD_TYPE}})

add_subdirectory(src)

include(CTest)
enable_testing()